package com.streamsets.common.model;

/**
 * 框架异常定义类
 *
 **/

public enum ResultCodeEnum {

    /**
     * ======================系统错误(1开头)=========================
     */
    SUCCESS("0000", "操作成功"),
    SERVICE_ERROR("1000", "系统异常"),
    BUSSINESS_ERROR("2001", "业务逻辑错误"),
    PARAM_VALID_FAIL("2002", "参数错误"),
    DATABASE_OPERATE_EXCEPTION("3001", "数据库操作异常"),


    /**
     * token及权限相关
     */
    API_UNAUTHORIZED("8001", "未授权的接口调用"),
    TOKEN_ERROR("8002", "token验证失败"),
    PERMISSION_ERROR("8003", "没有访问该资源的权限"),
    SIGN_ERROR("8004", "签名验证失败"),



    /**
     * 错误的请求
     */
    IO_ERROR("9001", "流读取异常");



    private String code;
    private String message;

    ResultCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    private void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    private void setMessage(String message) {
        this.message = message;
    }
}
